package security;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MultiLoginPageStrategy {
	public void process(HttpServletRequest request,  
	    HttpServletResponse response) throws IOException, ServletException {  
	    String targetUrl = null;  
	    String uri = request.getRequestURI();  
	    if (uri.indexOf("admin") != -1) {  
	        targetUrl = "/qidong/pages/jsp/sec/login.jsp";  
	    } else {  
	        targetUrl = "/qidong";  
	    }  
	    targetUrl = request.getContextPath() + targetUrl;  
	    response.sendRedirect(targetUrl);  
	}  
}
